package com.lz.core.http.sharing;

import com.lz.core.utils.Runner;
import io.vertx.core.AbstractVerticle;

/**
 * dff..
 *
 * @author Lizhong
 * @date 2019/9/4
 */
public class Client extends AbstractVerticle {

    // Convenience method so you can run it in your IDE
    public static void main(String[] args) {
        Runner.runExample(Client.class);
    }

    @Override
    public void start() throws Exception {
        vertx.setPeriodic(1000, (l) -> {
                    vertx.createHttpClient().getNow(8080, "localhost", "/", resp -> {
                        resp.bodyHandler(body -> {
                            System.out.println(body.toString("ISO-8859-1"));
                        });
                    });
                }
        );
    }
}